#Include <Misc.au3>

Global $coord[2]
while 1
	$coord = MouseGetPos()
	if _isPressed("01") Then
	$var = PixelGetColor( $coord[0] , $coord[1] )
	ExitLoop
	EndIf
WEnd
MsgBox(0,"The decmial color is", $var)
MsgBox(0,"The hex color is", Hex($var, 6))
